<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="author" content="wa">
    <title></title>
    <script src="../js/jquery-3.1.1.js"></script>
    <style>
        .top{
            width: 500px;
            border: 1px solid black;
            margin: 100px auto;
        }
        #xuan{
            height: 50px;
            background-color: black;
            color: white;
            line-height: 50px;
        }
        #xuan span{
            display: inline-block;
            padding: 0 20px;
            float: left;
            cursor: pointer;
        }
        #nr ul{
            text-align: center;
            list-style: none;
            display: none;
        }
        #nr .nei1{
            display: block;
        }
        .on{
            background-color: gray;
            color: black;
        }
    </style>
</head>
<body>
    <div class="top">
        <div id="xuan">
            <span class="on">选项一</span>
            <span>选项二</span>
            <span>选项三</span>
        </div>
        <div id="nr">
            <ul class="nei1">
                <li>内容1</li>
                <li>内容1</li>
            </ul>
            <ul class="nei2">
                <li>内容2</li>
                <li>内容2</li>
                <li>内容2</li>
            </ul>
            <ul class="nei3">
                <li>内容3</li>
                <li>内容3</li>
                <li>内容3</li>
                <li>内容3</li>
            </ul>
        </div>
    </div>
</body>
</html>
<script>

    $('#xuan span').mouseenter(function(){
        $(this).toggleClass('on').siblings().removeClass('on');
        var index=$(this).index();
        $('#nr ul').eq(index).show().siblings().hide();
    });

</script>